//
//  SCRadioPlayTableViewCell.m
//  LastOne
//
//  Created by dllo on 15/11/4.
//  Copyright © 2015年 sc. All rights reserved.
//

#import "SCRadioPlayTableViewCell.h"
#import "FitHeader.h"
@implementation SCRadioPlayTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createViews];
    }
    return self;
}

- (void)createViews
{
    _titleLabel = [[UILabel alloc] init];
    _titleLabel.font = [UIFont systemFontOfSize:16 * FitWidth];
    [self.contentView addSubview:_titleLabel];
    
    _timeLabel = [[UILabel alloc] init];
    _timeLabel.font = [UIFont systemFontOfSize:13 * FitWidth];
    [self.contentView addSubview:_timeLabel];
    
    _loadButton = [UIButton buttonWithType:UIButtonTypeSystem];
    [self.contentView addSubview:_loadButton];
}

- (void)setRadioModel:(SCRadioModel *)radioModel
{
    if (_radioModel != radioModel) {
        _titleLabel.text = radioModel.title;
        _timeLabel.text = [[radioModel.ptime componentsSeparatedByString:@" "] objectAtIndex:0];
    }
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    _titleLabel.frame = CGRectMake(10 * FitWidth, 10 * FitHeight, 290 * FitWidth, 30  * FitHeight);
    _timeLabel.frame = CGRectMake(_titleLabel.frame.origin.x, _titleLabel.frame.origin.y + _titleLabel.frame.size.height, _titleLabel.frame.size.width, 30 * FitHeight);
   // _loadButton.frame = CGRectMake(300, 5, 80, 60);
   // UIImage *image = [UIImage imageNamed:@"download"];
   // image = [image imageWithRenderingMode:0];
   // [_loadButton setImage:image forState:UIControlStateNormal];
    //_loadButton.backgroundColor = [UIColor redColor];
}
@end
